﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BT_DoHoa_Nhom13.EffectLib
{
    public class HightLightEffect : MyEffect
    {
        const int DEPTH = 5;
        static MyEffect instance;
        public static MyEffect GetInstance()
        {
            if (instance == null)
            {
                instance = new HightLightEffect();
            }

            return instance;
        }

        private HightLightEffect()
        {
            name = "Hightlight";
            kind = KIND.BOTTOM;
        }

        public override void Draw(MyGraphic graphic, MyShape shape)
        {
            MyShape shapeEffect = shape.Clone();
            this.CreateHightLight(shapeEffect);
            shapeEffect.SetFill(true);
            shapeEffect.Draw(graphic, null);

        }

        private void CreateHightLight(MyShape shape)
        {
            int top, left, width, height;
            shape.SetConfig(out top, out left, out width, out height);
            width += 2*DEPTH;
            height += 2*DEPTH;

            top -= DEPTH;
            left -= DEPTH;

            shape.SetStartPoint(left,top);
            shape.SetEndPoint(left + width, top + height);
        }

        
    }

}
